#include <iostream>
#include "clock.h"
using namespace std;
//实例化构造函数
Clock::Clock(int NewH, int NewM, int NewS)
{
    this->Hour = NewH;
    this->Minute = NewM;
    this->Second = NewS;
}
//实例化重载构造函数
Clock::Clock(Clock &c)
{
    this->Hour = c.Hour;
    this->Minute = c.Minute;
    this->Second = c.Second;
}
//实例化SetTime函数
void Clock::SetTime(int NewH, int NewM, int NewS)
{
    this->Hour = NewH;
    this->Minute = NewM;
    this->Second = NewS; //加不加this指针都一样
}
//实例化ShowTime函数
void Clock::ShowTime()
{
    cout << this->Hour << endl;
    cout << this->Minute << endl;
    cout << this->Second << endl;
}
//析构函数
Clock::~Clock()
{
}

int main()
{
    //实例化一个时钟对象c
    Clock c(0, 0, 0);
    c.ShowTime();
    //调用拷贝构造函数
    Clock c1(c);
    c1.ShowTime();
    c1.SetTime(90, 98, 99);
    c1.ShowTime();
    system("pause");
    return 0;
}